package com.un.web.topic.controller;

import com.un.core.common.R;
import com.un.web.topic.service.TopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.Random;

/**
 * @Author xingjian
 * @Date 2023-02-06
 **/
@RestController
@RequestMapping("topic")
public class TopicController {

    @Autowired
    private TopicService topicService;

    @PostMapping("approve/{id}")
    public R approve(@PathVariable Integer id) {
        topicService.saveTopic(id);
        return R.success();
    }
    @PostMapping("refuse/{id}")
    public R refuse(@PathVariable Integer id) {
        topicService.refuse(id);
        return R.success();
    }

    @GetMapping("randomTopic")
    public R randomTopic(){
        return R.success();
    }


}
